package com.crape.common.model;

import com.crape.common.constants.ConstantCode;
import com.crape.common.enums.AttentionType;
import com.crape.common.utils.LabelUtils;
import com.crape.common.utils.StringUtil;

/**
 * 用户详情类
 * 
 * @author ChenKai 2012-11-4 上午11:48:24
 */
public class AccountInfo {

    private Long    accountid;   // 用户ID
    private Long    attentions;  // 关注数
    private Long    fans;  		 // 粉丝数
    private Long    articles;    // 文章数
    private Long    questions;   // 问题数
    private Integer sex;         // 性别：0=女，1=男
    private String  title;       // 头衔
    private String  skilled;     // 擅长
    private String  imagename;   // 图片名称
    private String  image;       // 原图
    private String  area;        // 所在地
    private String  introduction; // 简介
    private String  createdate;  // 创建时间
    private String  modifydate;  // 修改时间

    // ==================================================
    private String[] skills;     // 擅长
    private String  uuid;        // UUID
    private String  email;       // 注册邮箱
    private String  username;    // 用户名
    private String  nickname;    // 用户昵称
    private String  password;    // 密码
    private Integer agree;       // 0=不同意，1=同意
    private Integer status;      // 用户状态：0=未激活，1=已激活，-1=被查封
    private Integer usertype;    // 用户类型：0=普通用户，1=达人，2=管理员
    private Integer darrenstatus; // 达人状态：0=未申请、1=待审核、2=已通过、-1=已拒绝
    private String  sys;         // 关联系统
    private String  loginid;     // 关联系统用户登陆ID
    private String  remark;      // 备注
    private Integer isattention = AttentionType.no.getCode(); // 是否被关注：0=未关注，1=已关注

    public Long getAccountid() {
        return accountid;
    }

    public void setAccountid(Long accountid) {
        this.accountid = accountid;
    }

    public Long getAttentions() {
        if (attentions == null) {
            return 0L;
        }
        return attentions;
    }

    public void setAttentions(Long attentions) {
        this.attentions = attentions;
    }

    public Long getFans() {
    	if (fans == null) {
            return 0L;
        }
		return fans;
	}

	public void setFans(Long fans) {
		this.fans = fans;
	}

	public Long getArticles() {
        if (articles == null) {
            return 0L;
        }
        return articles;
    }

    public void setArticles(Long articles) {
        this.articles = articles;
    }

	public Long getQuestions() {
		if (questions == null) {
			return null;
		}
		return questions;
	}

	public void setQuestions(Long questions) {
		this.questions = questions;
	}

	public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSkilled() {
        return skilled;
    }

    public void setSkilled(String skilled) {
        this.skilled = skilled;
    }

    public String getImagename() {
		return imagename;
	}

	public void setImagename(String imagename) {
		this.imagename = imagename;
	}

	public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

	public String[] getImages() {
		return StringUtil.imagesUrl(imagename, ConstantCode.imageSize);
	}

	public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getCreatedate() {
        return createdate;
    }

    public void setCreatedate(String createdate) {
        this.createdate = createdate;
    }

    public String getModifydate() {
        return modifydate;
    }

    public void setModifydate(String modifydate) {
        this.modifydate = modifydate;
    }

    public String[] getSkills() {
		if (skilled != null) {
			return LabelUtils.getLabels(skilled, "、");
		}
		return skills;
	}

	public void setSkills(String[] skills) {
		this.skills = skills;
	}

	public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getAgree() {
        return agree;
    }

    public void setAgree(Integer agree) {
        this.agree = agree;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getUsertype() {
        return usertype;
    }

    public void setUsertype(Integer usertype) {
        this.usertype = usertype;
    }

    public Integer getDarrenstatus() {
        return darrenstatus;
    }

    public void setDarrenstatus(Integer darrenstatus) {
        this.darrenstatus = darrenstatus;
    }

    public String getSys() {
        return sys;
    }

    public void setSys(String sys) {
        this.sys = sys;
    }

    public String getLoginid() {
        return loginid;
    }

    public void setLoginid(String loginid) {
        this.loginid = loginid;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getIsattention() {
        return isattention;
    }

    public void setIsattention(Integer isattention) {
        this.isattention = isattention;
    }

}
